package deepr.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class DeeprListResponse<T> extends Response<T> {

  private List<T> list;
  private Integer page;
  private Long totalPage;
  private Long totalCount = 0L;

  public DeeprListResponse() {

  }

  public void setTotalCount(Long totalCount, int pageSize) {
    if (totalCount == null) {
      totalPage = 1L;
      return;
    }
    this.totalCount = totalCount;
    totalPage = (totalCount - 1 + pageSize) / pageSize;
  }

}
